<?php
include ('../../__global.php');

class recommend_friend extends ml_controller {
    
    private $page;
    private $uid;
    

    public function init()
    {
        $this->set_access(self::ACCESS_SELF , self::NOACCESS_REDIRECT );
    }
    
    
    function initParam(){
        
        $this->page = intval($this->input('page' , '' , 1));
        if (1 > $this->page )
            $this->page = 1;
        
        $this->uid = $this->__visitor['uid'];
    }
    
    function checkParam(){
        
        
    }
    
    function main(){

        ml_tool_actionlog::add_other_action($this->uid , ML_SINAACTCODE_VIEW_RECOMMENDFRIEND);
        
        
        $data = array();
        $data['uid'] = $this->uid;
        //获取用户名片信息    


        $obizUser = ml_biz_user_getinfo::get_instance();
        $obizUser->initUser($this->uid,$this->uid);
        $arr = $obizUser->getUserArea();
        $data = array_merge($data,$arr);
        
        
        
        $o3rdSer=new ml_model_db3rdService();
        //sina
        $rs=$o3rdSer->get3rdServiceUser($this->uid,1,$wbInfo);
        
        if (empty($wbInfo)) {
            $data['3rdfollow'] = false;
        } else {
        $trd_follows = new ml_biz_extRelation_extFollow();
        $re = $trd_follows->get_meilauser_3rdfollowPage($this->uid, $this->page, 16);
        if (empty($re)) {
            $data['3rdfollow']['nofriend'] = true;
        } else {

        $data['3rdfollow'] = $re;
        $total_number = $data['3rdfollow']['total_number'];
        

        $this->set_scope_var('$totalPage' , floor($total_number / 16)+1);
        $this->set_scope_var('$currentPage' , $this->page);
        }
        }
        $title = '找朋友';
        $this->set_page_title($title);
        
        $this->page_output('relation::recommend_friend', $data);
    }
    
}

new recommend_friend();